<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
	  <title>爱宠医院管理系统</title>
	<meta http-equiv="pragma" content="no-cache"/>
	<meta http-equiv="cache-control" content="no-cache"/>
	<meta http-equiv="expires" content="0"/>    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
	<meta http-equiv="description" content="This is my page"/>
	<link href="css/Common.css" rel="stylesheet" type="text/css" />
    <link href="css/sitegeneric08.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../js/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="../js/public_fuc.js"></script>
    <style type="text/css">
    	#pager-div li {
		    display: inline;
		}
    </style>
  </head>
  
  <body>
<!-- head如果图片高度不合适。请修改Common.ces里面的".Header .HeaderTop"的高度。和".Header"的高度-->
<jsp:include flush="true" page="incTop.jsp"></jsp:include>    
<!-- head-->
	
	
<!--body-->
<div align="center" class="Wrapper">
<div id="MainCenter" align="center" class="MainCenter">
	     <div id="navigation" class="naivgation">
				<jsp:include flush="true" page="incLeft.jsp"></jsp:include>
		 </div>
		 <div id="content" >
				<div class="NewContainer771">
					<div class="BoxHeader">
						<div class="BoxHeader-center MarginTop10">治疗处理</div>
					</div>
					<div>
	                        <table class="table">
					              <thead>
						              <tr>
									     <th>宠物名</th>
									     <th>主人名</th>
									     <th>宠物编号</th>
									     <th>宠物年龄</th>
									     <th>病因</th>
									     <th>主人电话</th>
									     <th>就诊时间</th>
									     <th>处理</th>
									     <th>提交</th>
					                  </tr>
					              </thead>
					              <tbody id="content_body">
					              </tbody>
	        				</table>
	        				<!-- 分页按钮 -->
	        				<div id='pager-div' class="row" style="width: 50%; float: left;"> 
						         <ul class="pagination right" id="mypager"> 
						          <li class="current sy"><a>首页</a></li> 
						          <li class="current syy"><a>上一页</a></li> 
						          <li class="current xyy"><a>下一页</a></li> 
						          <li class="current wy"><a>尾页</a></li> 
						         </ul> 
						       </div> 
						    <span class="pagination_count">共<span id="sum_count"></span>条记录 | 第<span id="page_num">1</span>页 </span> 
                    </div>
				</div>
		 </div>
</div>
</div>
<!--body-->
	
	
	
<!--foot -->	
<div align="center" class="Wrapper">
	<div style="height: 40px;" align="center" class="Footer">
		<ul style="margin-top: 13px;">
			<li>
				<a>网站声明</a>&nbsp;&nbsp; |&nbsp;&nbsp;
				<a>服务网点</a>&nbsp;&nbsp; |&nbsp;
				<a>网站地图</a>&nbsp; |&nbsp;&nbsp;
				<a>联系我们</a>&nbsp;&nbsp; |&nbsp;&nbsp;
				<a>客服热线：********</a> 
			</li>
		</ul>
	</div>
</div>
<!--foot -->
<script type="text/javascript">

$(function(){
	loadData(1);
});

var flag = true;
var number = 5;//查询的数量
var loadData = function(page){
	var obj = {};
	obj.page = page;
	obj.number = number;
	$.getJSON("../api/repair/list",obj,function(data){
		if (data.code==0) {
			//console.log(data)
			var arr = data.data;
			var html = '';
			for (var i=0,len=arr.length;i<len;i++) {
				var obj = arr[i];
				console.log(obj);
				var clas = 'success';
				if (i%2==1) { clas = 'danger'; }
				html += '<tr class="'+clas+'" onclick="javascript:window.location.href=\'repair_detail.jsp?'+$.param(obj)+'\'">'
				     +'<td>'+obj.title+'</td>'
				     +'<td>'+obj.building+'</td>'
				     +'<td>'+obj.houseNum+'</td>'
				     +'<td>'+obj.name+'</td>'
				     +'<td>'+obj.detail+'</td>'
				     +'<td>'+obj.phone+'</td>'
				     +'<td>'+(isEmpty(obj.state)?"未处理":"已处理")+'</td>'
				     +'<td>'+obj.evaluation+'</td>'
					  +'</tr>';
				
			}
			document.getElementById('content_body').innerHTML = html;
			document.getElementById('sum_count').innerHTML = data.count;
			//分页操作
			if(flag){
				pagebutton(data.pages);
				flag = false;					
			}
		}
	});
}

</script>	
</body>
</html>
